home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -in_the_mag- / reader_requests / wild / include / wabl / wabl.h < prev    next >
C/C++ Source or Header  |  2000-02-23  |  3KB  |  74 lines

  1. #ifndef    WILD_WABL_FORMAT
  2. #define WILD_WABL_FORMAT
  3.  
  4. #include <exec/types.h>
  5. #include <exec/lists.h>
  6. #include <utility/hooks.h>
  7.  
  8. // syntax: !&Comm/[Type|Name]
  9.  
  10. struct WABLFriend
  11. {
  12.  struct MinNode        WABL_F_Node;     
  13.  char            WABL_F_Comm[16]; // The command or attribute name
  14.  char             WABL_F_Type[16]; // The type of object linked
  15.  char            WABL_F_Name[32]; // The name of the object linked
  16.  struct WABLObject     *WABL_F_Object;
  17. };
  18.  
  19. // syntax: !$Comm/[Value]
  20.  
  21. struct WABLAttr
  22. {
  23.  struct MinNode        WABL_A_Node;    // Link to other attrs of the object
  24.  char            WABL_A_Comm[16]; // The command or attribute name
  25.  char            *WABL_A_Value;    // The value (no size limit: it's a pointer!)
  26.  ULONG            WABL_A_ValueLen; // Size of mem, to free then.
  27. };
  28.  
  29. // syntax: !#Type/[Name]
  30.  
  31. struct WABLObject
  32. {
  33.  struct MinNode        WABL_O_Node;    // Link to brothers.
  34.  struct WABLObject    *WABL_O_Parent;    // Parent object.
  35.  struct    MinList        WABL_O_Attrs;    // The attributes, defined with $ commands.
  36.  struct MinList        WABL_O_Friends;    // The friends, using & commands.
  37.  struct MinList        WABL_O_Childs;    // The child groups, defined with #??/ commands
  38.  char            WABL_O_Type[16]; // You define with the command: #Level/[..] type is "Level"
  39.  char            WABL_O_Name[32]; // You define with command's arg: #Level/[hey!] name is "hey!"
  40.  ULONG            WABL_O_UserData;    // when using, useful having a userdata prt.
  41.  struct    WABL        *WABL_O_WABL;
  42. };
  43.  
  44. struct WABL
  45. {
  46.  struct    MinNode        WABL_Node;    // Useless now.
  47.  struct    WABLObject    *WABL_Parent;    // Useless now.
  48.  struct    MinList        WABL_Attrs;    // The attributes, defined with $ commands.
  49.  struct MinList        WABL_Friends;    // Pointers to other objects, defined with & commands.
  50.  struct MinList        WABL_Childs;    // The child groups, defined with #??/ commands
  51.  ULONG            *WABL_Pool;    // memory pool of this WABL
  52.  ULONG            *WABL_File;    // passed to hooks
  53.  struct Hook        *WABL_GetChar;    // must return a char (call conv: A2:file A1:unused)
  54.  struct Hook        *WABL_PutChar;    // must write a char  (call conv: A2:file A1:byte to write)
  55. };
  56.  
  57. #define GetWABLChar(wabl) CallHookPkt(wabl->WABL_GetChar,wabl->WABL_File,NULL)
  58. #define PutWABLChar(wabl,byte) CallHookPkt(wabl->WABL_PutChar,wabl->WABL_File,byte)
  59.  
  60. #define    WABL_TagBase    0x84000000+('W'<<16)+2000    // WILDOTHER+2000
  61.  
  62. #define    WABL_FileHandle        WABL_TagBase+1        // passed as data to Get&PutChar hooks via A2. 
  63. #define WABL_GetCharHook    WABL_TagBase+2        // the hook pointer
  64. #define WABL_PutCharHook    WABL_TagBase+3        // the hook pointer
  65.  
  66. #define    WABL_NEWOBJECT    '#'
  67. #define    WABL_NEWATTR    '$'
  68. #define WABL_NEWFRIEND    '&'
  69. #define WABL_COMMENT    '*'
  70. #define WABL_ENDOBJECT    '-'
  71. #define WABL_ENDCOMMAND    '/'
  72. #define WABL_LINESTART    '!'
  73.  
  74. #endif